﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Configuration;

namespace SqlServerLib
{
    /// <summary>
    ///Sqlserver 的摘要说明
    /// </summary>
    public class Sqlserver
    {
        private string hostip;
        private string username;
        private string password;
        private bool IntegratedSecurity = false;
        private string connectstr = ConfigurationManager.ConnectionStrings["strWeb"].ConnectionString;
        public string Connectstr
        {
            get { return connectstr; }
            set { connectstr = value; }
        }
        public Sqlserver()
        {
            //
            //TODO: 在此处添加构造函数逻辑
            //
        }
        public Sqlserver(string host,string dbname,string username, string password, bool intergrated)
        {
            hostip = host;
            this.username = username;
            this.password = password;
            this.IntegratedSecurity = intergrated;
            connectstr =string.Format("Data Source={0};Initial Catalog={1};Persist Security Info=True;User ID={2};Password={3}",host,dbname,username,password);
        }



    }
}